﻿using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Runtime.Serialization;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Xml;
using System.Xml.Serialization;
using HT.DBUtility;
namespace HT.DAL
{
    public class Dal_Common
    {


        /// <param name="filed">想获取值 字段</param>
        /// <param name="tableName">表名</param>
        /// <param name="key">条件</param>
        /// <param name="condition">条件值</param>
        /// <returns></returns>
        public byte[] GetDataByFiled(string filed, string tableName, string key, string condition)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select " + filed + "  from  " + tableName + "  where " + key + "='" + condition + "' ");
            DataTable dt = SQLHelper.ExecuteDt(strSql.ToString());
            byte[] bytes = null;

            if (dt != null && dt.Rows.Count > 0)
            {

                bytes = dt.Rows[0][0] as byte[];
            }

            return bytes;
        }

      
         
    }

}